package com.muqi.server.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.muqi.server.domain.bo.CollaborativeFilteringBO;
import com.muqi.server.domain.po.CollaborativeFilteringPO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface CollaborativeFilteringMapper extends BaseMapper<CollaborativeFilteringPO> {
    @Select("select * from student_info where name LIKE CONCAT('%', #{name}, '%')")
    List<CollaborativeFilteringBO> getStudentsByName(@Param("name") String name);

    @Select({
            "<script>",
            "SELECT * FROM student_info WHERE name IN",
            "<foreach item='name' collection='names' open='(' separator=',' close=')'>",
            "#{name}",
            "</foreach>",
            "</script>"
    })
    List<CollaborativeFilteringBO> getStudentsByNames(@Param("names") List<String> names);
}
